<%@ page contentType="text/html;charset=UTF-8"%>
<%@ page import="org.springside.modules.security.springsecurity.SpringSecurityUtils" %>
<%@ include file="/common/taglibs.jsp"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<title>安全防护管理系统  角色授权</title>
	<%@ include file="/common/meta.jsp"%>
	<link href="${ctx}/css/qtable.css" type="text/css" rel="stylesheet">
	<link href="${ctx}/css/default.css" type="text/css" rel="stylesheet">
		<script src="${ctx}/js/jquery.js" type="text/javascript"></script>
		<script src="${ctx}/js/authority.js" type="text/javascript"></script>
</head>

<body>
<div id="menu">
<h3>
	<a href="${ctx}/security/user.action">帐号列表</a>
	<a href="${ctx}/security/role.action">角色列表</a> 
	<a href="${ctx}/j_spring_security_logout">退出登录</a>
</h3>
</div>

<div id="message"><s:actionmessage theme="mytheme"/></div>

<div id="filter">你好,<%=SpringSecurityUtils.getCurrentUserName()%>.</div>
<input type="hidden" name="roleId" id="roleId" value="${roleId}" />

<div id="qtableContent">
<table id="qtable">
	<tr>
		<th><b>权限名</b></th>
		<th><b>权限功能</b></th>
		<th><b>操作</b></th>
	</tr>

	<s:iterator value="allAuths" var="auth">
		<tr>
			<td width="30%">${name}</td>
			<td width="45%">${displayName}</td>
			<td width="25%">&nbsp;
				<security:authorize ifAnyGranted="A_MODIFY_ROLE">
				<c:if test="${isAuth }"><a id="auth${id }" class="authority" href="javascript:authRole(${id})">已授权</a></c:if>
				<c:if test="${isNotAuth }"><a id="auth${id }" class="nauthority" href="javascript:authRole(${id})">未授权</a></c:if>
				</security:authorize>
			</td>
		</tr>
	</s:iterator>
</table>
</div>
<div id="qtableFooter"><a href="${ctx}/security/role.action">返回角色列表</a></div>
</body>
</html>